package utils.蓝桥杯.字符串;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @description:
 * @author: qian
 * @createDate: 2021/11/1
 */
public class 单词分析 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char[] chars = str.toCharArray();
        Map<Character,Integer> map = new HashMap<>();
        for (int i = 0; i < chars.length; i++) {
            map.put(chars[i],map.getOrDefault(chars[i],0) + 1);
        }
        int numb = 0;
        char c = ' ';

        for (Map.Entry<Character,Integer> entry : map.entrySet()) {

            if (numb < entry.getValue()) {
                numb = entry.getValue();
                c = entry.getKey();
            }
        }

        System.out.println(c);
        System.out.println(numb);
        scan.close();
    }
}
